#ifndef BLOCKINGQUEUE_H_
#define BLOCKINGQUEUE_H_

#include <pthread.h>
#include <semaphore.h>
#include <stdlib.h>
/**
 *
 * */

typedef struct node{
	void * data;
	struct node* next;
}llNode;

typedef struct linkList{
	llNode * head;
	llNode * tail;
	int size;
}linkList;

void initList(linkList* list);
void addNode(linkList * list, llNode * node);
llNode* removeNode(linkList* list);

typedef struct blockingQueue{
	linkList* list;
	sem_t* sem;
	pthread_mutex_t* mutex;
}blockingQueue;

void initBQueue(blockingQueue* queue);
void bqueueEnqueue(blockingQueue * queue, llNode * node);
llNode* bqueueDequeue(blockingQueue* queue);
void killBQueue(blockingQueue* queue);



#endif /*BLOCKINGQUEUE_H_*/
